import { withPublicPath } from '@/utils/publicPath'
import { readonly } from 'vue'

/**
 * 规范所有颜色色值格式遵循`#RRGGBB`格式
 * @note 记住所有英文字母**大写**
 */
export const predefinedColors: Option<string>[] = [
  { value: '#1964FE', label: '#1964FE' },
  { value: '#0EA2FF', label: '#0EA2FF' },
  { value: '#776AFD', label: '#776AFD' },
  { value: '#00BB64', label: '#00BB64' },
  { value: '#16C7A3', label: '#16C7A3' },
  { value: '#CFA75B', label: '#CFA75B' },
  { value: '#FCC600', label: '#FCC600' },
  { value: '#FF8427', label: '#FF8427' },
  { value: '#FF4444', label: '#FF4444' },
  { value: '#573838', label: '#573838' },
]
/** 默认主题色 */
export const defaultDesignerThemeColor = predefinedColors[3].value
export const followThemeValue = {
  /** 深 */
  deep: 1,
  /** 浅 */
  light: 0,
}
/** 限制主题色颜色格式仅`#RRGGBB`格式 */
export const designerThemeColorValueRegEx = /^#[a-z0-9]{6}$/i
/** 上传图片最大限制大小(4MB) */
export const maxFileSize = 4 * 1024 * 1024
/** 图标选择弹框中iconfont矢量图标类名 */
export const iconfontCls = readonly([
  'icon-zixun',
  'icon-biaodan',
  'icon-baozhang',
  'icon-dianzan',
  'icon-fuli',
  'icon-dushu',
  'icon-guihua',
  'icon-fuwu',
  'icon-biaoqian',
  'icon-huiyuan',
  'icon-duihua',
  'icon-gouwudai',
  'icon-biye',
  'icon-haoping',
  'icon-kefu',
  'icon-leibei',
  'icon-lishi',
  'icon-liangdian',
  'icon-redu',
  'icon-shipin',
  'icon-qiangdai',
  'icon-tisheng',
  'icon-xuexiao',
  'icon-gongju',
  'icon-tongji',
  'icon-renzheng',
  'icon-zizhi',
  'icon-ziliao',
  'icon-zhuanye',
  'icon-tuandui',
  'icon-hezuo',
  'icon-shuben',
  'icon-mianfei',
  'icon-mubiao',
  'icon-tianxie',
  'icon-shoucang',
])
/** 图标选择弹框中图片图标 */
export const imageIcons = readonly(Object.keys(import.meta.glob('/public/images/icon-selects/*', { eager: true })).map((path) => {
  return withPublicPath(path.replace(/^\/public/, ''))
}))
export const boolishOptions: Option<boolean>[] = [
  { value: true, label: '是' },
  { value: false, label: '否' },
]
